package com.andertrift.controller;
import java.util.ArrayList;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.andertrift.connectors.FacebookConnector;

import facebook4j.FacebookException;
import facebook4j.Post;

@Controller
@RequestMapping("comment")
public class CommentsController {
	
	FacebookConnector conn = new FacebookConnector();
	
	@RequestMapping(method = RequestMethod.GET)
	public ModelAndView printComments() throws FacebookException {
		ArrayList<Post> comments = (ArrayList<Post>) conn.getCommentList();
		return new ModelAndView("comment", "comments", comments);
		
	}


}
